package xcmg.device.web.report;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.ApiOperation;
import xcmg.device.infra.BasicController;
import xcmg.device.service.report.LocationReportService;
import xcmg.device.service.vo.report.LocationReportConditionVO;
import yb.ecp.fast.infra.annotation.FastMappingInfo;
import yb.ecp.fast.infra.infra.ActionResult;
import yb.ecp.fast.infra.infra.SearchCommonVO;

@RestController
@RequestMapping("/locationReport")
public class LocationReportController extends BasicController {

	@Autowired
	private LocationReportService locationReportService;
	
	@RequestMapping(value = "/pageList",method = RequestMethod.POST)
    @ApiOperation("查询缺货报表")
    @FastMappingInfo(needLogin = true)
	public ActionResult pageList(@RequestBody SearchCommonVO<LocationReportConditionVO> conditionVO) throws Exception {
		String orgId = getOrgId();
		return actionValueResult(locationReportService.pageList(conditionVO, orgId).getPageInfo());
	}
	
	@RequestMapping(value = "/export",method = RequestMethod.POST)
    @ApiOperation("查询缺货报表")
    @FastMappingInfo(needLogin = true)
	public void export(LocationReportConditionVO conditionVO) throws Exception {
		//LocationReportConditionVO conditionVO = new LocationReportConditionVO();
		String orgId = getOrgId();
		locationReportService.export(conditionVO, orgId);
	}
	
}
